﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataMappers;
using ExaminationTT.Model;


namespace ConcreteMappersAndObjects.DomainObjects
{
    public class Course : DomainObject<int , Course> , ICourse
    {
        private string _acronym;

        private string _name;

        private readonly IEnumerable<CourseCU> _cUints;

        public Course() : base() { }
        
        public Course(int id, string acronym, string name, IEnumerable<CourseCU> cUints) : base(id)
        {
            _acronym = acronym;
            _name = name;
            _cUints = cUints;
        }

        protected override Course Self()
        {
            return this;
        }

        public string Acronym
        {
            get { return _acronym; }
            set { _acronym = value; MarkDirty(); }
        }

        public string Name
        {
            get { return _name; }
            set { _name = value; MarkDirty(); }
        }

        public IEnumerable<CourseCU> CUints
        {
            get { return _cUints.ToList(); }
                    }

        #region ICourse Members


        IEnumerable<ICourseCU> ICourse.CUints
        {
            get { return _cUints.ToList(); }
        }

        #endregion
    }
}
